using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Roll : MonoBehaviour
{
    public Scrollbar sb;
    public float speed = 0.001f;
    void Start()
    {

    }
    void Update()
    {
        StartCoroutine("SB");
    }
    IEnumerator SB()
    {
        yield return new WaitForEndOfFrame();
        if (sb.value > 0)
        {
            sb.value = sb.value - speed;
        }
        else
        {
            sb.value = 2;
        }
    }
}
